#pragma once

#include <base.h>

typedef struct __packed {
	uint64_t rax;
	uint64_t rbx;
	uint64_t rcx;
	uint64_t rdx;
	uint64_t rsi;
	uint64_t rdi;
	uint64_t rbp;
	uint64_t r8;
	uint64_t r9;
	uint64_t r10;
	uint64_t r11;
	uint64_t r12;
	uint64_t r13;
	uint64_t r14;
	uint64_t r15;
} regs_block_t;

typedef struct __packed {
	uint64_t cr3;
	uint8_t fxsave_buf[512];
	regs_block_t regs;

	uint64_t irq_index;
	uint64_t err_code;

	uint64_t rip;
	uint64_t cs;
	uint64_t rflags;
	uint64_t rsp;
	uint64_t ss;
} intr_regs_frame_t;

void intr_init();
void intr_load_idt();